﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="FL.Web.BackEnd.LoginPage" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title><% =SystemName %></title> 
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <script src="/SFramework/boot.js"></script>
    <style>
    	*{
			margin:0;
			padding:0;
			font-size:18px;
			font-family:"Microsoft Yahei",arial;
			line-height:32px;	 
        }
		html,body{
			height:100%;	
        }
		html{
			background:#fff;overflow-y:scroll
        }
		body{
			background:url(images/Bg.gif) no-repeat 50% 0;
            /*height:960px;*/
        }
		label{
			color:white;	
        }
		.login1{
			width:640px;
			height:380px; 
			background:url(images/login.png) center center no-repeat;
			position:absolute;
			left:50%;
			top:0;
			margin-left:-320px;
			margin-top:190px;	
        }
		.login1 .table1{
			width:320px;
			margin:80px 160px;	
            }
		/*input[type="text"],input[type="password"]{
			width:320px;
			height:40px;
			height:32px;
			border:none;
			background:url(images/input_bg.gif)	
        }
		input[type="button"]{
			width:320px;
			height:40px;
			border:none;
			background:url(images/sub_bg.png) center center no-repeat;
			margin-top:12px;
			color:white;	
        }*/
        input.text,input.password{
			width:320px;
			height:40px;
			height:32px;
			border:none;
			background:url(images/input_bg.gif)	
        }
		input.button{
			width:320px;
			height:40px;
			border:none;
			background:url(images/sub_bg.png) center center no-repeat;
			margin-top:12px;
			color:white;	
        }
         .errorText
         {
        color:red;
       }
    </style>
  
</head>
<body>

    <div class="Title"></div>
    <div class="login1">
        <table class="table1">
                <tr><td id="errormessage" class="errorText"></td></tr>
            <tr>
                	<td><label for="username">用户名：</label></td>
            </tr>
            <tr>
                    <td><input id='username' type="text" class="text" /></td>
            </tr>
            <tr>
                	<td><label for="password">密&nbsp;码：</label></td>
            </tr>
            <tr>
                    <td><input id="password" type="password" class="password" /></td>	
            </tr>
            <tr>
                <td>
                    <input id="btnLogin" type="button" value="登陆" class="button" /></td>
            </tr>

        </table>
    </div>
</body>
<script>
    $("#btnLogin").click(fnLogin);
    function fnLogin() {
        $.ajax({
            url: "login.aspx?action=login&r=" + Math.random(),
            type: "post",
            data: { username: $("#username").val(), password: $("#password").val() },
            cache: false,
            success: function (text) {
                //alert(text);
                if (text == 1) {
                    document.location = "main.aspx?r=" + Math.random();
                    return;
                }
                $("#errormessage").html(text);
                //    alert("数据保存失败!")
                //}
            },
            error: function (jqXHR, textStatus, errorThrown) {
                alert(jqXHR.responseText);
            }
        });
    }
</script>
</html>
